﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

namespace WebService1
{
    /// <summary>
    /// Service1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            DateTime dt1 = new DateTime(1970, 1, 1);
            DateTime dt2 = DateTime.Now.AddMonths(-12);
            TimeSpan ts = dt2 - dt1;

            return ts.TotalSeconds.ToString();
        }

        [WebMethod(Description = "Date  ---  时间;Mobile  ---  手机;Version --- 版本;Model --- 手机型号;Other --- 其它信息")]        
        public bool SaveInfo(string date, string mobile, string version, string model, string IMSI, string IMEI, string other)
        {
            try
            {
                return true;
            }
            catch 
            {
                return false;
            }
        }
    }
}
